<template>
  <div class="docRegistration">
    <van-pull-refresh v-model="loading" @refresh="onRefresh">
      <navBar :name="name" />
      <div class="docRegistration_name">眼科门诊</div>
      <div class="docRegistration_time">
        <div class="docRegistration_time_left">全部</div>
        <div class="docRegistration_time_right">
          <scroll><liunxTime :value="clicked" :valueChange="value" /></scroll>
        </div>
      </div>
      <div class="docRegistration_mask"></div>
      <div class="docRegistration_bottom">
        <div class="docRegistration_bottom_body">
          <div class="docRegistration_bottom_item">
            <div class="docRegistration_bottom_item_img">
              <img
                src="https://q1.qlogo.cn/g?b=qq&nk=1044910888@qq.com&s=100"
                alt=""
              />
            </div>
            <div class="docRegistration_bottom_item_right">
              <div class="docRegistration_left" @click="toDoctorDetails">
                <div class="docRegistration_left_top van-ellipsis">
                  <span class="docRegistration_left_top_title">李德</span>
                  <span class="docRegistration_left_top_bot">副主任</span>
                </div>
                <div class="docRegistration_left_bot van-ellipsis">
                  我爱你我爱你我爱你我爱你我爱你我爱你我爱你我爱你
                </div>
              </div>
              <div class="docRegistration_right">
                <div class="docRegistration_right_box">
                  <doctorReg />
                </div>
              </div>
            </div>
          </div>
          <div class="docRegistration_bottom_item">
            <div class="docRegistration_bottom_item_img">
              <img
                src="https://q1.qlogo.cn/g?b=qq&nk=1044910888@qq.com&s=100"
                alt=""
              />
            </div>
            <div class="docRegistration_bottom_item_right">
              <div class="docRegistration_left">
                <div class="docRegistration_left_top van-ellipsis">
                  <span class="docRegistration_left_top_title">李德</span>
                  <span class="docRegistration_left_top_bot">副主任</span>
                </div>
                <div class="docRegistration_left_bot van-ellipsis">
                  我爱你我爱你我爱你我爱你我爱你我爱你我爱你我爱你
                </div>
              </div>
              <div class="docRegistration_right">
                <div class="docRegistration_right_box">
                  <doctorReg :item="false" />
                </div>
              </div>
            </div>
          </div>
          <div class="docRegistration_bottom_item">
            <div class="docRegistration_bottom_item_img">
              <img
                src="https://q1.qlogo.cn/g?b=qq&nk=1044910888@qq.com&s=100"
                alt=""
              />
            </div>
            <div class="docRegistration_bottom_item_right">
              <div class="docRegistration_left">
                <div class="docRegistration_left_top van-ellipsis">
                  <span class="docRegistration_left_top_title">李德</span>
                  <span class="docRegistration_left_top_bot">副主任</span>
                </div>
                <div class="docRegistration_left_bot van-ellipsis">
                  我爱你我爱你我爱你我爱你我爱你我爱你我爱你我爱你
                </div>
              </div>
              <div class="docRegistration_right">
                <div class="docRegistration_right_box">
                  <doctorReg :item="false" />
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="docRegistration_bottom_tips">没有更多了~</div>
      </div>
    </van-pull-refresh>
  </div>
</template>

<script>
import scroll from "../../../scroll/scroll.vue";
import liunxTime from "../../../commonComponents/liunxTime.vue";
import { useRouter } from "vue-router";
import doctorReg from "./components/register.vue";
import { Toast } from "vant";
import { reactive, toRefs } from "vue";
import navBar from "@/components/commonComponents/navBar.vue";
export default {
  name: "docRegistration",
  components: { navBar, doctorReg, liunxTime, scroll },
  setup() {
    const router = useRouter();
    const item = "select";
    const data = reactive({
      name: "选择医生",
      loading: false,
      clicked: "2/29日",
    });
    function onRefresh() {
      setTimeout(() => {
        Toast("刷新成功");
        data.loading = false;
      }, 1000);
    }
    function toDoctorDetails() {
      router.push("/home/consultation/doctorDetails");
    }
    function value(newValue) {
      data.clicked = newValue;
    }
    return {
      ...toRefs(data),
      onRefresh,
      toDoctorDetails,
      value,
      item,
    };
  },
};
</script>

<style lang="scss" scope>
.docRegistration .docRegistration_bottom_item:nth-child(1) {
  border-top: none;
}
.docRegistration {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  z-index: 10;
  &_left {
    width: 70%;

    display: flex;
    flex-direction: column;
    &_top {
      flex: 1;

      display: flex;
      align-items: center;
      &_title {
        margin-right: 10px;
        font-size: 18px;
        font-weight: 550;
      }
      &_bot {
        font-size: 14px;
        color: #acacac;
      }
    }
    &_bot {
      width: 100%;

      font-size: 14px;
      overflow: hidden;
      color: #acacac;
    }
  }
  &_right {
    width: 30%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    &_box {
      width: 100%;
    }
  }
  & .van-pull-refresh {
    height: 100%;
  }
  &_mask {
    background-color: #fafafa;
    width: 100%;
    height: 20px;
  }
  &_bottom {
    margin-top: 10px;
    background-color: #fff;
    width: 100%;
    padding: 0 10px 10px 20px;
    &_item {
      display: flex;
      padding-top: 20px;
      margin-bottom: 20px;
      border-top: 1px solid #ccc;
      &_img {
        width: 50px;
        margin-right: 10px;
        height: 50px;
        border-radius: 50%;
        overflow: hidden;
        & img {
          object-fit: cover;
          width: 100%;
          height: 100%;
        }
      }
      &_right {
        width: 82%;
        display: flex;
      }
    }
    &_tips {
      text-align: center;
      color: #acacac;
      font-size: 14px;
      margin-top: 50px;
    }
  }
  &_name {
    background-color: #fff;
    font-size: 16px;
    padding: 15px;
  }
  &_time {
    width: 100%;
    display: flex;
    height: 90px;
    background-color: #fff;
    border-top: 1px solid #dedede;
    &_left {
      flex: none;
      width: 16%;
      height: 100%;

      border-right: 1px solid #dedede;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #2356e2;
      font-size: 18px;
    }
    &_right {
      width: 84%;
      white-space: nowrap;
      overflow: hidden;
      box-sizing: border-box;
    }
  }
}
</style>
